package com.acoffee.maven.controller.controller.controller;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.annotation.Annotation;

/**
 * Spring2.5之前创建Hanler只有一个办法就是要自定义的类实现Controller接口
 * @author acoffee
 * @create 2021-05-05 15:30
 */
public class HelloController implements Controller {

    @Override
    public ModelAndView handleRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
        System.out.println("HelloController===>handleRequest");
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("/welcome.jsp");
        return modelAndView;
    }
}
